package com.atguigu.java5;

import org.junit.Test;

/**
 * @author : leimingchao
 * @date Date : 2021年06月21日 21:36
 */
public class TestLambda {

    @Test
    public void test() {
        //jdk 1.7之前，必须是final
        int num = 10;
        Runnable r = new Runnable() {
            @Override
            public void run() {
                System.out.println("Hello World!" + num);
            }
        };
        r.run();
        System.out.println("---------------------------");
        Runnable r1 = () -> System.out.println("Hello Lambda!" + num);
        r1.run();
    }


}
